void   tableinter   (void)
{
    // float point operations should be changed with int cause performance
    float   x,y,x1,y1,x2,y2,temp;
    signed  int16  pw_corr;

    //x1= (obt*REV_S)+REV_MIN;
    x1 = in_parm.frpm_table[obt];

    //x2 = ((obt+1)*REV_S)+REV_MIN;
    x2 = in_parm.frpm_table[obt+1];
    x = oboroti;
    y1 = in_parm.ve_table[0][mapt][obt];         //fmap[obt][mapt];   //in_parm.ve_table[NO_INJ][NO_FMAPS][NO_FRPMS]
    y2 = in_parm.ve_table[0][mapt][obt+1];       //fmap[obt+1][mapt];

    //y= y1+(((y2-y1)*(x-x1))/(x2-x1));
    //temp=y;
    temp = y1+(((y2-y1)*(x-x1))/(x2-x1));

    y1 = in_parm.ve_table[0][mapt+1][obt];       //fmap[obt][mapt+1];
    y2 = in_parm.ve_table[0][mapt+1][obt+1];     //fmap[obt+1][mapt+1];
    y= y1+(((y2-y1)*(x-x1))/(x2-x1));

    //x1= ((float)mapt*MAP_S)+MAP_MIN;                      //29->49 (adesh*2)
    x1 = in_parm.fmap_table[mapt];

    //x2= (((float)mapt+1)*MAP_S)+MAP_MIN;              //29->49 (adesh*2)
    x2 = in_parm.fmap_table[mapt+1];
    y2 = y;
    y1 = temp;
    x = k_pa;                                     //x=adct; this is old bu may by it was incorrect
    y = y1+(((y2-y1)*(x-x1))/(x2-x1));           //ve %

    pw_corr = (((signed int8) in_parm.BatFac * ( 132 - out_parm.batt)) / 60)+
        in_parm.InjOpen; // open time correction

    //y = (y * out_parm.egocor1) / 100;               // apply wb O2 based correction

    //out_parm.pw1 = (unsigned int16)(((in_parm.ReqFuel*(y/100))+(pw_corr*100)+((signed int16)pw_acc * 100))/100)*pw_corr_per;   // fuel pulsewidth (usec) at wide open throttle
    //better Ve resolutions (may be) 
    //final pulse                                                                            req_fuel                                            batt correction              acc pulse                                                            warm up corr % 
    //out_parm.pw1 = (unsigned int16)(((((in_parm.ReqFuel * y)/100)+
    //    (pw_corr*100)+((int16)pw_acc * 100))*pw_corr_per)/100);

    out_parm.pw1 = (unsigned int16)(((((((in_parm.ReqFuel * y)/100) * out_parm.egocor1)/100)+
        (pw_corr*100)+((int16)pw_acc * 100))*pw_corr_per)/100);

    timeinj = (unsigned int16)((TMR_CONST * out_parm.pw1)/1000);    //loss of the resolution
    //printf("timeinj %Lu; CONST%Lu; pw %Lu; calc %Lu;",timeinj,TMR_CONST,out_parm.pw1,(unsigned int16)(((TMR_CONST/100) * out_parm.pw1)/10));
                        
    out_parm.vecurr1 = (unsigned int8)y;    //timeinj=(unsigned int8)y+INJ_GO_OPEN;

    //debug only !!!
    out_parm.pw2     = (unsigned int16)((in_parm.ReqFuel * y) / 100);
    out_parm.vecurr2 = in_parm.ve_table[0][mapt][obt];

    return;     
}

